<template>
  <!-- 药方卡片组件 -->
  <div>
    <div class="p_item"
         v-for="(i,ins) in prescriptionList"
         :key="ins">
      <div class="flex-box">
        <div class="p_left">
          <div class="items">药物类型: <span>{{i.drug_type}}</span></div>
        </div>
        <div class="p_right">
          <div class="items">具体药物: <span>{{i.drug_name}}</span></div>
        </div>
      </div>
      <!-- 分割线 -->
      <div class="flex-box">
        <div class="p_left">
          <div class="items">给药途径: <span>{{i.drug_way}}</span></div>
        </div>
        <div class="p_right">
          <div class="items">剂量及频率: <span>{{i.frequency}}</span></div>
        </div>
      </div>
      <van-icon v-if="showDelIcon"
                @click="$emit('del', ins)"
                class="del-icon"
                color="#FFF"
                size="5"
                name="cross" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    prescriptionList: {
      type: Array,
      default: () => []
    },
    showDelIcon: {
      type: Boolean,
      default: false
    }
  },
  name: '',
  data () {
    return {

    }
  },
  created () {

  },
  methods: {

  }
}
</script>

<style scoped lang="less">
// 用药处方
// .prescription {
// width: 100%;
// margin-bottom: 25px;
// .add {
//   width: 96px;
//   height: 32px;
//   background: linear-gradient(180deg, #3eb3ff 0%, #436eff 100%);
//   border: none;
//   font-size: 14px;
//   color: #ffffff;
//   letter-spacing: 1px;
//   margin-bottom: 15px;
//   border-radius: 8px;
// }
.p_item {
  position: relative;
  width: 100%;
  // height: 71px;
  padding: 12px 15px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid rgba(112, 112, 112, 0.23137254901960783);
  border-radius: 8px;
  margin-bottom: 10px;
  .flex-box {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
  }
  .p_left,
  .p_right {
    flex: 1;
  }
  .p_left {
    text-align: left;
  }
  .p_right {
    text-align: right;
  }
  .del-icon {
    position: absolute;
    top: -10px;
    right: 0;
    background-color: #436eff;
    border-radius: 50%;
    padding: 5px;
  }
  .items {
    // height: 20px;
    font-size: 12px;
    font-family: PingFang SC;
    font-weight: 600;
    // line-height: 30px;
    color: #161616;
    span {
      color: #a0a0a0;
    }
  }
}
</style>
